From 036e6bd11be95e3e78d2316b0cf0847740b539bc Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Tue, 22 Jan 2008 09:43:53 +0000 Subject: [PATCH] Make tools/Makefile cross-friendly Pass Xen cross-compilation options through to ioemu. Export CROSS_SYS_ROOT for use by scripts. Unexport IOEMU_DIR since it isn't used outside of the Makefile. Signed-off-by: Aron Griffis --- tools/Makefile | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index f023fbb500..14abf6026d 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -28,6 +28,12 @@ SUBDIRS-$(PYTHON_TOOLS) += python SUBDIRS-$(PYTHON_TOOLS) += pygrub endif +# For the sake of linking, set the sys-root +ifneq ($(CROSS_COMPILE),) +CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root +export CROSS_SYS_ROOT +endif + .PHONY: all all: check @set -e; for subdir in $(SUBDIRS-y); do \ @@ -65,10 +71,15 @@ check_clean: .PHONY: ioemu ioemuinstall ioemuclean ifeq ($(CONFIG_IOEMU),y) -export IOEMU_DIR ?= ioemu +IOEMU_DIR ?= ioemu +ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH)) +IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \ + --interp-prefix=$(CROSS_SYS_ROOT) +endif ioemu ioemuinstall: [ -f $(IOEMU_DIR)/config-host.mak ] || \ - (cd $(IOEMU_DIR) && sh configure --prefix=/usr) + ( cd $(IOEMU_DIR) && sh configure --prefix=/usr \ + $(IOEMU_CONFIGURE_CROSS) ) $(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@) ioemuclean: $(MAKE) -C $(IOEMU_DIR) distclean -- 2.30.2